package com.ys.zero.biz;

import java.util.List;

import com.ys.zero.bean.Uarticle;
import com.ys.zero.dao.SearchDao;

/**
 * 搜索Biz
 * @author Administrator
 *
 */
public class SearchBiz {
	
	private SearchDao dao = new SearchDao();
	
	/**
	 * 首页
	 * @param keyword
	 * @return
	 * @throws BizException 
	 */
	public List<Uarticle> seaech(String keyword) throws BizException{
		if(keyword.isEmpty()||keyword.trim().isEmpty()) {
			throw new BizException("搜索关键词不能为空");
		}
		List<Uarticle> list = dao.seaech(keyword);
		if(list.isEmpty()) {
			throw new BizException("没有结果");
		}
		return list;
	}
}
